package com.qkl.xiatang.app.entity.sms;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

@Data
@TableName(value = "sms_dynamic_config")
public class SmsDynamicConfig {

    @TableId(type= IdType.ASSIGN_ID)
    private String id;

    private String accessKey;

    private String secret;

    @TableField(value = "do_main")
    private String domain;

    private String regionId;

    private String version;

    private String signName;

    private String templateCode;

    private Integer expireTime;

    private Integer verifyTimes;

    /**
     * 配置未完善
     * @return
     */
    public boolean configNotFinish(){
        return null == expireTime || expireTime <= 0 || null == verifyTimes || verifyTimes <= 0 || StringUtils.isAnyEmpty(version,signName,templateCode,domain,regionId,accessKey,secret);
    }

}
